﻿/**
 * ...
 * @author aboutwhat
 */

package bloom.io;
import bloom.Lib;
import neko.FileSystem;

typedef FS = FileSystem;

using StringTools;

class FileFilter 

{
    public static var hxExtensionFilter = extensionFilter("hx");
	public static var asExtensionFilter = extensionFilter("as");
	public static var hxmlExtensionFilter = extensionFilter("hxml");
    
    public static inline var noFilter = Lib.isTrue;
    
    public static function eRegFilter ( er : EReg ) {
        return function (s : String) return er.match(s);
    }
    
	public static function extensionFilter( extension : String) 
	{
		return function (s : String) return s.endsWith(extension);
	}
	
	public static var isFile = function (s : String) return !FS.isDirectory(s);
	
	public static var isDirectory = function (s : String) return FS.isDirectory(s);
	
	
	
    
}